local hx__longnu = fk.CreateSkill{
    name = "hx__longnu",

    tags = {Skill.Wake},
}

hx__longnu:addEffect(fk.EnterDying,{
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(hx__longnu.name) and target and target == player and player:usedSkillTimes(hx__longnu.name,Player.HistoryGame) == 0
    end,
    on_cost = Util.TrueFunc,
    on_use = function (self, event, target, player, data)
        local room = player.room
        room:changeHp(player,player.maxHp - player.hp)
        if player.general == "hxjsct__agong" then
            room:setPlayerProperty(player,"general","hxjsct__agong__juexing")
        elseif player.deputyGeneral and player.deputyGeneral == "hxjsct__agong" then
            room:setPlayerProperty(player,"deputyGeneral","hxjsct__agong__juexing")
        end
        room:handleAddLoseSkills(player,"hx__longxiao|hx__longgu|hx__longbao|hx__longji",nil,true,true)
    end,
})

return hx__longnu